﻿using _1_DBFirst;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _5_ConnWithMysql
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            using (var db = new BloggingContext("name=MyConnectionString"))
            {
                var blog = new Blogs { Name = "王五" };
                db.Blogs.Add(blog);
                db.SaveChanges();
            }
        }
    }
}
